package com.ruoyi.auth.controller;

import com.ruoyi.auth.service.UserService;
import com.ruoyi.common.core.domain.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class TestController {

    private final UserService userService;

    @Autowired
    public TestController(UserService userService) {
        this.userService = userService;
    }

    @GetMapping("/fetch-users")
    public R<?> fetchUsers(@RequestParam(value = "username", required = false) String username) {
        return userService.fetchUsers(username);
    }
}
